Check if a number is prime